package com.yipei.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yipei.business.domain.MlInvestmentProducts;
import com.yipei.business.mapper.MlInvestmentProductsMapper;
import com.yipei.business.service.IMlInvestmentProductsService;
import com.yipei.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 基金产品Service业务层处理
 *
 * @author yipei
 * @date 2025-07-14
 */
@Service
public class MlInvestmentProductsServiceImpl  extends ServiceImpl<MlInvestmentProductsMapper, MlInvestmentProducts> implements IMlInvestmentProductsService
{
    @Autowired
    private MlInvestmentProductsMapper mlInvestmentProductsMapper;

    /**
     * 查询基金产品
     *
     * @param id 基金产品主键
     * @return 基金产品
     */
    @Override
    public MlInvestmentProducts selectMlInvestmentProductsById(Long id)
    {
        return mlInvestmentProductsMapper.selectMlInvestmentProductsById(id);
    }

    /**
     * 查询基金产品列表
     *
     * @param mlInvestmentProducts 基金产品
     * @return 基金产品
     */
    @Override
    public List<MlInvestmentProducts> selectMlInvestmentProductsList(MlInvestmentProducts mlInvestmentProducts)
    {
        return mlInvestmentProductsMapper.selectMlInvestmentProductsList(mlInvestmentProducts);
    }

    /**
     * 新增基金产品
     *
     * @param mlInvestmentProducts 基金产品
     * @return 结果
     */
    @Override
    public int insertMlInvestmentProducts(MlInvestmentProducts mlInvestmentProducts)
    {
        mlInvestmentProducts.setCreateTime(DateUtils.getNowDate());
        return mlInvestmentProductsMapper.insertMlInvestmentProducts(mlInvestmentProducts);
    }

    /**
     * 修改基金产品
     *
     * @param mlInvestmentProducts 基金产品
     * @return 结果
     */
    @Override
    public int updateMlInvestmentProducts(MlInvestmentProducts mlInvestmentProducts)
    {
        mlInvestmentProducts.setUpdateTime(DateUtils.getNowDate());
        return mlInvestmentProductsMapper.updateMlInvestmentProducts(mlInvestmentProducts);
    }

    /**
     * 批量删除基金产品
     *
     * @param ids 需要删除的基金产品主键
     * @return 结果
     */
    @Override
    public int deleteMlInvestmentProductsByIds(Long[] ids)
    {
        return mlInvestmentProductsMapper.deleteMlInvestmentProductsByIds(ids);
    }

    /**
     * 删除基金产品信息
     *
     * @param id 基金产品主键
     * @return 结果
     */
    @Override
    public int deleteMlInvestmentProductsById(Long id)
    {
        return mlInvestmentProductsMapper.deleteMlInvestmentProductsById(id);
    }
}
